const TokenKey = 'admin-token';
const TokenPrefix = 'Bearer ';
const StudentListKey = 'student-list';
function isLogin() {
  return !!uni.getStorageSync(TokenKey);
}
function getToken() {
  return uni.getStorageSync(TokenKey);
}
function setToken(token: string) {
  uni.setStorageSync(TokenKey, token);
}
function clearToken() {
  uni.removeStorageSync(TokenKey);
}

function setSignInfo(info: string) {
  uni.setStorageSync('signInfo', info);
}
function getSignInfo() {
  return uni.getStorageSync('signInfo');
}

function setNavigationHeight(info: string) {
  uni.setStorageSync('navigation-total-height', info);
}
function getNavigationHeight() {
  return uni.getStorageSync('navigation-total-height');
}

function setEntryType(info: string) {
  uni.setStorageSync('entryType', info);
}

function getEntryType() {
  return uni.getStorageSync('entryType');
}

function getStudentList() {
  return uni.getStorageSync(StudentListKey);
}
function setStudentList(list: Array<any>) {
  uni.setStorageSync(StudentListKey, list);
}
function clearStudentList() {
  uni.removeStorageSync(StudentListKey);
}
export { TokenPrefix, isLogin, getToken, setToken, clearToken, setSignInfo, getSignInfo, setNavigationHeight, getNavigationHeight, setEntryType, getEntryType, setStudentList, getStudentList, clearStudentList };
